home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Science / RasMol2 / tokens.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-28  |  13.4 KB  |  460 lines  |  [TEXT/KAHL]

  1. /* tokens.h
  2.  * RasMol2 Molecular Graphics
  3.  * Roger Sayle, October 1994
  4.  * Version 2.5
  5.  */
  6.  
  7. /* Lexeme Tokens */
  8. #define IdentTok       256
  9. #define NumberTok      257
  10. #define FloatTok       258
  11. #define StringTok      259
  12.  
  13. /* Command Tokens */
  14. #define BackboneTok    260
  15. #define CentreTok      261
  16. #define ClipboardTok   262
  17. #define ColourTok      263
  18. #define ConnectTok     264
  19. #define DefineTok      265
  20. #define DisplayTok     266
  21. #define EchoTok        267
  22. #define HelpTok        268
  23. #define LabelTok       269
  24. #define LoadTok        270
  25. #define PrintTok       271
  26. #define QuitTok        272
  27. #define RenumTok       273
  28. #define ResetTok       274
  29. #define ResizeTok      275
  30. #define RestrictTok    276
  31. #define RotateTok      277
  32. #define SaveTok        278
  33. #define ScriptTok      279
  34. #define SelectTok      280
  35. #define SetTok         281
  36. #define ShowTok        282
  37. #define SlabTok        283
  38. #define SourceTok      284
  39. #define SpacefillTok   285
  40. #define StructureTok   286
  41. #define SymmetryTok    287
  42. #define TraceTok       288
  43. #define TranslateTok   289
  44. #define WaitTok        290
  45. #define WireframeTok   291
  46. #define WriteTok       292
  47. #define ZapTok         293
  48. #define ZoomTok        294
  49.  
  50. /* Predicate Tokens */
  51. #define IsPredTok(x)   (((x)>=300) && ((x)<=338))
  52. #define PredTokOrd(x)  ((x)-300)
  53. #define PredTokChr(x)  ((x)+300)
  54.  
  55. #define AlphaTok       300
  56. #define AminoTok       301
  57. #define ATTok          302
  58. #define BondedTok      303
  59. #define CGTok          304
  60. #define CystineTok     305
  61. #define DNATok         306
  62. #define HelixTok       307
  63. #define HeteroTok      308
  64. #define HydrogenTok    309
  65. #define IonTok         310
  66. #define LigandTok      311
  67. #define MainChainTok   312
  68. #define NucleicTok     313
  69. #define ProteinTok     314
  70. #define PurineTok      315
  71. #define PyrimidineTok  316
  72. #define RNATok         317
  73. #define SelectedTok    318
  74. #define SheetTok       319
  75. #define SidechainTok   320
  76. #define SolventTok     321
  77. #define TurnTok        322
  78. #define WaterTok       323
  79.  
  80. #define AcidicTok      324
  81. #define AcyclicTok     325
  82. #define AliphaticTok   326
  83. #define AromaticTok    327
  84. #define BasicTok       328
  85. #define BuriedTok      329
  86. #define ChargedTok     330
  87. #define CyclicTok      331
  88. #define HydrophobicTok 332
  89. #define LargeTok       333
  90. #define MediumTok      334
  91. #define NeutralTok     335
  92. #define PolarTok       336
  93. #define SmallTok       337
  94. #define SurfaceTok     338
  95.  
  96.  
  97. /* Property Tokens */
  98. #define IsPropTok(x)   (((x)>=340) && ((x)<=344))
  99. #define TemperatureTok 340
  100. #define RadiusTok      341
  101. #define AtomNoTok      342
  102. #define ElemNoTok      343
  103. #define ResNoTok       344
  104.  
  105. /* File Format Tokens */
  106. #define IsMoleculeFormat(x)  (((x)>=350) && ((x)<=356))
  107. #define PDBTok         350
  108. #define AlchemyTok     351
  109. #define CharmmTok      352
  110. #define Mol2Tok        353
  111. #define XYZTok         354
  112. #define CIFTok         355
  113. #define MDLTok         356
  114.  
  115. /* Raster Tokens */
  116. #define IsImageFormat(x) (((x)>=360) && ((x)<=372))
  117. #define GIFTok         360
  118. #define PPMTok         361
  119. #define SUNTok         362
  120. #define SUNRLETok      363
  121. #define EPSFTok        364
  122. #define PICTTok        365
  123. #define IRISTok        366
  124. #define BMPTok         367
  125. #define MonoPSTok      368
  126. #define VectPSTok      369
  127. #define KinemageTok    370
  128. #define MolScriptTok   371
  129. #define POVRayTok      372
  130.  
  131. /* Feature Tokens */
  132. #define AtomTok        380
  133. #define BondTok        381
  134. #define DotsTok        382
  135. #define HBondTok       383
  136. #define RibbonTok      384
  137. #define SSBondTok      385
  138. #define Ribbon1Tok     386
  139. #define Ribbon2Tok     387
  140.  
  141. /* Expression Tokens */
  142. #define TrueTok        390
  143. #define FalseTok       391
  144. #define AllTok         392
  145. #define NoneTok        393
  146. #define AndTok         394
  147. #define OrTok          395
  148. #define NotTok         396
  149. #define WithinTok      397
  150. #define XorTok         398
  151.  
  152. /* Colour Tokens */
  153. #define BlueTok        400
  154. #define BlueTintTok    401
  155. #define BlackTok       402
  156. #define BrownTok       403
  157. #define CyanTok        404
  158. #define GoldTok        405
  159. #define GrayTok        406
  160. #define GreenTok       407
  161. #define GreenblueTok   408
  162. #define GreenTintTok   409
  163. #define HotPinkTok     410
  164. #define MagentaTok     411
  165. #define OrangeTok      412
  166. #define PinkTok        413
  167. #define PinkTintTok    414
  168. #define PurpleTok      415
  169. #define RedTok         416
  170. #define RedorangeTok   417
  171. #define SeaTok         418
  172. #define SkyTok         419
  173. #define VioletTok      420
  174. #define WhiteTok       421
  175. #define YellowTok      422
  176. #define YellowTintTok  423
  177.  
  178. #define CPKTok         424
  179. #define ShapelyTok     425
  180. #define UserTok        426
  181. #define GroupTok       427
  182. #define ChainTok       428
  183. #define TypeTok        429
  184. #define PotentialTok   430
  185. #define ChargeTok      431
  186.  
  187. /* Variable Tokens */
  188. #define AmbientTok     440
  189. #define AxesTok        441
  190. #define BackgroundTok  442
  191. #define BondModeTok    443
  192. #define BoundBoxTok    444
  193. #define FontSizeTok    445
  194. #define HourGlassTok   446
  195. #define MenusTok       447
  196. #define MouseTok       448
  197. #define ShadowTok      449
  198. #define SlabModeTok    450
  199. #define SpecularTok    451
  200. #define SpecPowerTok   452
  201. #define StrandsTok     453
  202. #define UnitCellTok    454
  203.  
  204. /* SlabMode Tokens */
  205. #define RejectTok      460
  206. #define HalfTok        461
  207. #define HollowTok      462
  208. #define SolidTok       463
  209. #define SectionTok     464
  210.  
  211. /* MouseMode Tokens */
  212. #define RasMolTok      465
  213. #define InsightTok     466
  214. #define QuantaTok      467
  215.  
  216. /* Information Tokens */
  217. #define InfoTok        470
  218. #define SequenceTok    471
  219. #define VersionTok     472
  220.  
  221. /* Display Mode Tokens */
  222. #define NormalTok      475
  223. #define StereoTok      476
  224. #define MonoTok        477
  225.  
  226. /* Axis Tokens */
  227. #define XTok           480
  228. #define YTok           481
  229. #define ZTok           482
  230.  
  231.  
  232. typedef struct {
  233.                 char *ident;
  234.                 int token;
  235.                } KeywordEntry;
  236.  
  237.  
  238. #define MAXKEYLEN 11
  239. static int KeyLen[MAXKEYLEN+1] = {
  240.         0, 3, 8, 27, 57, 88, 134, 162, 182, 197, 200, 205 };
  241.  
  242. static KeywordEntry Keyword[] = {
  243.             { "X",  XTok },
  244.             { "Y",  YTok },
  245.             { "Z",  ZTok },  /* 3 */
  246.  
  247.             { "AT", ATTok   },
  248.             { "CG", CGTok   },
  249.             { "ON", TrueTok },
  250.             { "OR", OrTok   },
  251.             { "PS", EPSFTok },  /* 8 */
  252.  
  253.             { "ALL", AllTok   },
  254.             { "AND", AndTok   },
  255.             { "BMP", BMPTok   },
  256.             { "CIF", CIFTok   },
  257.             { "CPK", CPKTok   },
  258.             { "DNA", DNATok   },
  259.             { "GIF", GIFTok   },
  260.             { "ION", IonTok   },
  261.             { "MDL", MDLTok   },
  262.             { "NOT", NotTok   },
  263.             { "OFF", FalseTok },
  264.             { "PDB", PDBTok   },
  265.             { "PPM", PPMTok   },
  266.             { "RED", RedTok   },
  267.             { "RNA", RNATok   },
  268.             { "SET", SetTok   },
  269.             { "SUN", SUNTok   },
  270.             { "XYZ", XYZTok   },
  271.             { "ZAP", ZapTok   }, /* 27 */
  272.  
  273.             { "ATOM", AtomTok },
  274.             { "AXES", AxesTok },
  275.             { "AXIS", AxesTok },
  276.             { "BLUE", BlueTok },
  277.             { "BOND", BondTok },
  278.             { "CYAN", CyanTok },
  279.             { "DOTS", DotsTok },
  280.             { "ECHO", EchoTok },
  281.             { "EPSF", EPSFTok },
  282.             { "EXIT", QuitTok },
  283.             { "HALF", HalfTok },
  284.             { "HELP", HelpTok },
  285.             { "INFO", InfoTok },
  286.             { "IONS", IonTok  },
  287.             { "IRIS", IRISTok },
  288.             { "LOAD", LoadTok },
  289.             { "MOL2", Mol2Tok },
  290.             { "MONO", MonoTok },
  291.             { "NONE", NoneTok },
  292.             { "PICT", PICTTok },
  293.             { "QUIT", QuitTok },
  294.             { "SAVE", SaveTok },
  295.             { "SHOW", ShowTok },
  296.             { "SLAB", SlabTok },
  297.             { "TRUE", TrueTok },
  298.             { "TURN", TurnTok },
  299.             { "TYPE", TypeTok },
  300.             { "USER", UserTok },
  301.             { "WAIT", WaitTok },
  302.             { "ZOOM", ZoomTok }, /* 57 */
  303.  
  304.             { "ALPHA", AlphaTok  },
  305.             { "AMINO", AminoTok  },
  306.             { "ATOMS", AtomTok   },
  307.             { "BASIC", BasicTok  },
  308.             { "BLACK", BlackTok  },
  309.             { "BONDS", BondTok   },
  310.             { "CHAIN", ChainTok  },
  311.             { "COLOR", ColourTok },
  312.             { "FALSE", FalseTok  },
  313.             { "GREEN", GreenTok  },
  314.             { "GROUP", GroupTok  },
  315.             { "HBOND", HBondTok  },
  316.             { "HELIX", HelixTok  },
  317.             { "LABEL", LabelTok  },
  318.             { "LARGE", LargeTok  },
  319.             { "MENUS", MenusTok  },
  320.             { "MOUSE", MouseTok  },
  321.             { "PAUSE", WaitTok   },
  322.             { "POLAR", PolarTok  },
  323.             { "PRINT", PrintTok  },
  324.             { "RENUM", RenumTok  },
  325.             { "RESET", ResetTok  },
  326.             { "RESNO", ResNoTok  },
  327.             { "SHEET", SheetTok  },
  328.             { "SMALL", SmallTok  },
  329.             { "SOLID", SolidTok  },
  330.             { "TRACE", TraceTok  },
  331.             { "TURNS", TurnTok   },
  332.             { "WATER", WaterTok  },
  333.             { "WHITE", WhiteTok  },
  334.             { "WRITE", WriteTok  },  /* 88 */
  335.  
  336.             { "ACIDIC", AcidicTok },
  337.             { "ATOMNO", AtomNoTok },
  338.             { "BONDED", BondedTok },
  339.             { "BURIED", BuriedTok },
  340.             { "CENTER", CentreTok },
  341.             { "CENTRE", CentreTok },
  342.             { "CHARGE", ChargeTok },
  343.             { "CHARMM", CharmmTok },
  344.             { "COLORS", ColourTok },
  345.             { "COLOUR", ColourTok },
  346.             { "CYCLIC", CyclicTok },
  347.             { "DEFINE", DefineTok },
  348.             { "ELEMNO", ElemNoTok },
  349.             { "HBONDS", HBondTok  },
  350.             { "HETERO", HeteroTok },
  351.             { "HOLLOW", HollowTok },
  352.             { "LABELS", LabelTok  },
  353.             { "LIGAND", LigandTok },
  354.             { "MEDIUM", MediumTok },
  355.             { "MONOPS", MonoPSTok },
  356.             { "NORMAL", NormalTok },
  357.             { "ORANGE", OrangeTok },
  358.             { "POVRAY", POVRayTok },
  359.             { "PURINE", PurineTok },
  360.             { "PURPLE", PurpleTok },
  361.             { "QUANTA", QuantaTok },
  362.             { "RADIUS", RadiusTok },
  363.             { "RASMOL", RasMolTok },
  364.             { "RASWIN", RasMolTok },
  365.             { "REJECT", RejectTok },
  366.             { "RESIZE", ResizeTok },
  367.             { "RIBBON", RibbonTok },
  368.             { "ROTATE", RotateTok },
  369.             { "SCRIPT", ScriptTok },
  370.             { "SELECT", SelectTok },
  371.             { "SHADOW", ShadowTok },
  372.             { "SHEETS", SheetTok  },
  373.             { "SOURCE", SourceTok },
  374.             { "SSBOND", SSBondTok },
  375.             { "STEREO", StereoTok },
  376.             { "SUNRLE", SUNRLETok },
  377.             { "VECTPS", VectPSTok },
  378.             { "VIOLET", VioletTok },
  379.             { "WATERS", WaterTok  },
  380.             { "WITHIN", WithinTok },
  381.             { "YELLOW", YellowTok },  /* 134 */
  382.  
  383.             { "ACYCLIC", AcyclicTok },
  384.             { "ALCHEMY", AlchemyTok },
  385.             { "AMBIENT", AmbientTok },
  386.             { "CHARGED", ChargedTok },
  387.             { "CHARGES", ChargeTok  },
  388.             { "COLOURS", ColourTok  },
  389.             { "CONNECT", ConnectTok },
  390.             { "CYSTINE", CystineTok },
  391.             { "DISPLAY", DisplayTok },
  392.             { "HELICES", HelixTok   },
  393.             { "INSIGHT", InsightTok },
  394.             { "LIGANDS", LigandTok  },
  395.             { "MAGENTA", MagentaTok },
  396.             { "NEUTRAL", NeutralTok },
  397.             { "NUCLEIC", NucleicTok },
  398.             { "PROTEIN", ProteinTok },
  399.             { "PURINES", PurineTok  },
  400.             { "RESIDUE", GroupTok   },
  401.             { "RIBBON1", Ribbon1Tok },
  402.             { "RIBBON2", Ribbon2Tok },
  403.             { "RIBBONS", RibbonTok  },
  404.             { "SECTION", SectionTok },
  405.             { "SHADOWS", ShadowTok  },
  406.             { "SHAPELY", ShapelyTok },
  407.             { "SOLVENT", SolventTok },
  408.             { "SSBONDS", SSBondTok  },
  409.             { "STRANDS", StrandsTok },
  410.             { "SURFACE", SurfaceTok },  /* 162 */
  411.  
  412.             { "AROMATIC", AromaticTok },
  413.             { "BACKBONE", BackboneTok },
  414.             { "BONDMODE", BondModeTok },
  415.             { "BOUNDBOX", BoundBoxTok },
  416.             { "FONTSIZE", FontSizeTok },
  417.             { "HYDROGEN", HydrogenTok },
  418.             { "KINEMAGE", KinemageTok },
  419.             { "NEGATIVE", AcidicTok   },
  420.             { "POSITIVE", BasicTok    },
  421.             { "RENUMBER", RenumTok    },
  422.             { "RESTRICT", RestrictTok },
  423.             { "RIBBONS1", Ribbon1Tok },
  424.             { "RIBBONS2", Ribbon2Tok },
  425.             { "SELECTED", SelectedTok },
  426.             { "SEQUENCE", SequenceTok },
  427.             { "SLABMODE", SlabModeTok },
  428.             { "SOLVENTS", SolventTok  },
  429.             { "SPECULAR", SpecularTok }, 
  430.             { "SYMMETRY", SymmetryTok },
  431.             { "UNITCELL", UnitCellTok },  /* 182 */
  432.  
  433.             { "ALIPHATIC", AliphaticTok },
  434.             { "CLIPBOARD", ClipboardTok },
  435.             { "GREENBLUE", GreenblueTok },
  436.             { "HOURGLASS", HourGlassTok },
  437.             { "MAINCHAIN", MainChainTok },
  438.             { "MOLSCRIPT", MolScriptTok },
  439.             { "MOUSEMODE", MouseTok     },
  440.             { "POTENTIAL", PotentialTok },
  441.             { "REDORANGE", RedorangeTok },
  442.             { "SIDECHAIN", SidechainTok },
  443.             { "SPACEFILL", SpacefillTok },
  444.             { "SPECPOWER", SpecPowerTok },
  445.             { "STRUCTURE", StructureTok },
  446.             { "TRANSLATE", TranslateTok },
  447.             { "WIREFRAME", WireframeTok },  /* 197 */
  448.  
  449.             { "BACKGROUND", BackgroundTok },
  450.             { "MONOCHROME", MonoTok       },
  451.             { "PYRIMIDINE", PyrimidineTok },  /* 200 */
  452.  
  453.             { "BOUNDINGBOX", BoundBoxTok    },
  454.             { "HYDROPHOBIC", HydrophobicTok },
  455.             { "INFORMATION", InfoTok        },
  456.             { "PYRIMIDINES", PyrimidineTok, },
  457.             { "TEMPERATURE", TemperatureTok }  /* 205 */
  458.                 };
  459.  
  460.